<?php

 require_once("../include/httpclient.php");
 require_once("../include/db_mysql.php");
// serviceurl：1002 站内搜索，根据productName进行搜索
function daogou_search_product($arg)
{
//返回第几页的数据，一页30户商家
 $return = array();
 $input =stripslashes($arg['input']);;
 $link = new SqlClass();
	//连接数据库
 $link->connect();
 $cmd = "select productName,mainPic,price,description from dg_product where locate('$input',productName)>0";	  
 $rs = $link->exec_sql($cmd);	
 while($row=mysql_fetch_array($rs))
{	
	$productionArray = array();
	$productionArray['productName'] =  $row['productName'];
	$productionArray['main_pic'] =  $row['mainPic'];
	$productionArray['price'] =  $row['price'];
	array_push($return,$productionArray);
}
 return json_encode($return);
}
?>